home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / rbbs_pc / colr174.zip / RSB4COLR.MRG < prev   
Text File  |  1992-06-26  |  8KB  |  175 lines

  1. * ------------[ BLED merge (c) Ken Goosens ]-------------
  2. * Merge this against RBBSSUB4.BAS to produce RBBSSUB4.NEW
  3. * RBBSSUB4.BAS:  Date 3-5-1992  Size 127923 bytes
  4. * ------------[ Created 05-17-1992 01:46:05 ]------------
  5. * REPLACING old line(s) by new
  6. 58250 ' $SUBTITLE: 'SmartText - smart text substitution'
  7. ' $PAGE
  8. '
  9. '  NAME    -- SmartText   (WRITTEN BY DOUG AZZARITO)
  10. '
  11. '  INPUTS  -- StringWork$        string to scan for Smart Text
  12. '             CRFound            Does this line contain a CR?
  13. '             ZSmartTextCode     Smart Text control code
  14. '
  15. '  OUTPUTS -- StringWork$        Input string with Smart replaced
  16. '
  17. '  PURPOSE -- Smart Text allows control strings in text files
  18. '             to be replaced at runtime with user info or other
  19. '             data.  The Smart Text control code is a 1-byte
  20. '             code (configurable) with a 2-byte action code.
  21. '
  22.       SUB SmartText (StringWork$, CRFound, OverStrike) STATIC
  23.       IF SmartCarry$<>"" THEN _
  24.          StringWork$ = SmartCarry$+StringWork$
  25.       Index = INSTR(StringWork$, ZSmartTextCode$)
  26.       WHILE Index > 0 AND Index < LEN(StringWork$)-1
  27.          IF INSTR(MID$(StringWork$, Index+1,2)," ") THEN _
  28.             SmartAct = 0 _
  29.          ELSE _
  30.             SmartAct = INSTR(ZSmartTable$, MID$(StringWork$, Index+1, 2))
  31.          IF SmartAct = 0 THEN _
  32.             WasI = 1 : _
  33.             GOTO 58254
  34.          SmartAct = (SmartAct+2)/3
  35.          ON SmartAct GOSUB 58260, 58261, 58262, 58263, 58264, 58265, _
  36.                            58266, 58267, 58268, 58269, 58270, _
  37.                            58271, 58272, 58273, 58274, 58275, _
  38. * ------[ first line different ]------
  39.                            58276, 58277, 58296, 58297, 58298, _      ' COLR174
  40.                            58299, 58278, 58279, 58280, _             ' COLR174
  41.                            58281, 58282, 58283, 58284, 58285, _
  42.                            58286, 58287, 58289, 58290, 58291, _
  43.                            58292, 58293, 58294, 58295
  44.          GOSUB 58256
  45.          WasI = LEN(SmartHold$)
  46.          ReplaceLen = 3
  47.          IF OverStrike OR Overlay THEN _
  48.             IF WasI > 2 THEN _
  49.                ReplaceLen = WasI _
  50.             ELSE _
  51.                SmartHold$ = SmartHold$ + SPACE$(3 - WasI)
  52.          StringWork$ = LEFT$(StringWork$, Index-1) + SmartHold$ + _
  53.                        MID$(StringWork$,Index+ReplaceLen)
  54. * REPLACING old line(s) by new
  55. * ------[ first line different ]------
  56. 58294 SmartHold$ = ZSysopLastName$          ' LS Sysops Last Name    ' RM051701
  57.       CALL NameCaps(SmartHold$)
  58.       RETURN
  59. * REPLACING old line(s) by new
  60. 58295 SmartHold$ = ZConfName$               ' CN Conference Name
  61.       RETURN
  62. * ------[ first line different ]------
  63. * INSERTING new line(s)
  64. 58296 SmartHold$ = ZFG5$                    ' C5 Color 5             ' COLR174
  65.       GOTO 58258                                                     ' COLR174
  66. 58297 SmartHold$ = ZFG6$                    ' C6 Color 6             ' COLR174
  67.       GOTO 58258                                                     ' COLR174
  68. 58298 SmartHold$ = ZFG7$                    ' C7 Color 7             ' COLR174
  69.       GOTO 58258                                                     ' COLR174
  70. 58299 SmartHold$ = ZFG8$                    ' C8 Color 8             ' COLR174
  71.       GOTO 58258                                                     ' COLR174
  72.       END SUB
  73. '
  74. * REPLACING old line(s) by new
  75. 59934 ' $SUBTITLE: 'SetHiLite - subroutine to reset highlight preference'
  76. ' $PAGE
  77. '
  78. '  NAME    --  SetHiLite
  79. '
  80. '  INPUTS  --  PARAMETER                   MEANING
  81. '              SetTo              New value (True or False)
  82. '              ZEmphasizeOnDef$   String turns emphasize on
  83. '              ZEmphasizeOffDef$  String turns emphasize off
  84. '
  85. '  OUTPUTS --  ZHiLiteOff       Callers preference on Hilite
  86. '              ZEmphasizeOn$       String to use for emphasis
  87. '              ZEmphasizeOff$      String to use after emphasis
  88. '
  89.       SUB SetHiLite (SetTo) STATIC
  90.       ZHiLiteOff = (ZEmphasizeOnDef$ <> "" AND SetTo)
  91.       IF ZHiLiteOff THEN _
  92.          ZEmphasizeOn$ = "" : _
  93.          ZEmphasizeOff$ = "" : _
  94.          ZFG1$ = "" : _
  95.          ZFG2$ = "" : _
  96.          ZFG3$ = "" : _
  97. * ------[ first line different ]------
  98.          ZFG4$ = "" : _                                              ' COLR174
  99.          ZFG5$ = "" : _                                              ' COLR174
  100.          ZFG6$ = "" : _                                              ' COLR174
  101.          ZFG7$ = "" : _                                              ' COLR174
  102.          ZFG8$ = "" _                                                ' COLR174
  103.       ELSE ZEmphasizeOn$ = ZEmphasizeOnDef$ : _
  104.            ZFG1$ = ZFG1Def$ : _
  105.            ZFG2$ = ZFG2Def$ : _
  106.            ZFG3$ = ZFG3Def$ : _
  107.            ZFG4$ = ZFG4Def$ : _                                      ' COLR174
  108.            ZFG5$ = ZEscape$ + "[1;40;31m" : _   ' RED                ' COLR174
  109.            ZFG6$ = ZEscape$ + "[1;40;34m" : _   ' BLUE               ' COLR174
  110.            ZFG7$ = ZEscape$ + "[1;40;37m" : _   ' WHITE              ' COLR174
  111.            ZFG8$ = ZEscape$ + "[1;37;44m"       ' WHITE ON BLUE      ' COLR174
  112.       END SUB
  113. * REPLACING old line(s) by new
  114. 59965 ' $SUBTITLE: 'UserColor - lets user set color for normal text'
  115. ' $PAGE
  116. '
  117. '  NAME    --  UserColor
  118. '
  119. '  INPUTS  --  PARAMETER                   MEANING
  120. '              ZEmphasizeOff$            Normal text color
  121. '
  122. '  OUTPUTS --  ZEmphasizeOff$            New text color
  123. '              ZBoldText$                Whether bold (0 not, 1 bold)
  124. '              ZUserTextColor            ANSI Color selected
  125. '
  126. '  PURPOSE --  Lets caller select desired color and whether bold.
  127. '
  128.       SUB UserColor STATIC
  129.       IF ZHiLiteOff THEN _
  130. * ------[ first line different ]------
  131.          EXIT SUB _                                                  ' COLR174
  132.       ELSE _                                                         ' COLR174
  133.          ZFG5$ = ZEscape$ + "[1;40;31m" : _     ' RED                ' COLR174
  134.          ZFG6$ = ZEscape$ + "[1;40;34m" : _     ' BLUE               ' COLR174
  135.          ZFG7$ = ZEscape$ + "[1;40;37m" : _     ' WHITE              ' COLR174
  136.          ZFG8$ = ZEscape$ + "[1;37;44m"         ' WHITE ON BLUE      ' COLR174
  137. * REPLACING old line(s) by new
  138. 59980 ' $SUBTITLE: 'SetGraphic - Sets user graphic preference'
  139. ' $PAGE
  140. '
  141. '  NAME    --  SetGraphic
  142. '
  143. '  INPUTS  --  PARAMETER                   MEANING
  144. '              GraphicsNumber        0=None, 1=Ascii, 2=color
  145. '
  146. '  OUTPUTS --  ZWasGR                Shared var - set to
  147. '                                    graphics.number
  148. '              ZUserGraphicDefault$ What add to file name to
  149. '                                    see if got graphics file ver
  150. '
  151. '  PURPOSE --  Sets file graphics preference
  152. '
  153.       SUB SetGraphic (GraphicsNumber) STATIC
  154.       ZWasGR = GraphicsNumber
  155.       IF ZWasGR = 2 THEN _
  156.          ZDR1$ = ZFG1Def$ : _
  157.          ZDR2$ = ZFG2Def$ : _
  158.          ZDR3$ = ZFG3Def$ : _
  159. * ------[ first line different ]------
  160.          ZDR4$ = ZFG4Def$ : _                                        ' COLR174
  161.          ZDR5$ = ZFG5$ : _                                           ' COLR174
  162.          ZDR6$ = ZFG6$ : _                                           ' COLR174
  163.          ZDR7$ = ZFG7$ : _                                           ' COLR174
  164.          ZDR8$ = ZFG8$ _                                             ' COLR174
  165.       ELSE ZDR1$ = "" : _
  166.            ZDR2$ = "" : _
  167.            ZDR3$ = "" : _
  168.            ZDR4$ = "" : _                                            ' COLR174
  169.            ZDR5$ = "" : _                                            ' COLR174
  170.            ZDR6$ = "" : _                                            ' COLR174
  171.            ZDR7$ = "" : _                                            ' COLR174
  172.            ZDR8$ = ""                                                ' COLR174
  173.       ZUserGraphicDefault$ = MID$(" GC",ZWasGR+1, - (ZWasGR > 0))
  174.       END SUB
  175.